package org.jeecg.modules.zhouAdmin.admin.alipayrefund;

import com.alipay.api.DefaultAlipayClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AlipayConfig {

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2017112300119442";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDvk3B5BjLAaVAZJeok/GXntonJqVpV8J2rVVNeU8VqQZRpViq1W8shmymu4BupF8TE4obm/bQeBLkqaOCIiRyfKCHGbozjiVkNGGfc5H5oq8GyXRFKCWqg9FnxGJm5Mau9h600kcTHS/5TEpgOp3dhnW9LHyim3LsfuD/lciP/MD0F5zISg/+YtwBBSfbtd7dstNTy4oADbanHEK56MXTn6VW6EUJ+EtVUKF4qbbVTUEf+lCe9e1HezUfP9Zk7pM4TPJMB70jWxqh55/hrE7BSFfCXFc28YqfJSQ+Ih9UrgB2RKZPbqgPz5ytg2Oi/0vxPtxRthJxydDeHSEabvk4pAgMBAAECggEBAIsGhVtF1IfB1WBylxiVe1FmpTjoVOrQMb7uSe3QMRyDJ+ukvC34Mb2zvBGmLYcHqwER73T2PuK4nPdWWw4AeyKE+GydVJbp6kpmIkeWNSDqowGtbk4HfuAeTF9Thklo4J+gr0t1V7rLh6+Pd7vxRJ7Z7G6sizuhldlHY5Tzkp4PsZ+CmR82B6vz1/LmnlN51x971s4G46rXIb6EIggR6EI70qGYKGVsx8B1VkLPHCWrjUf9qhYTDSdIA06Lfhw1kxPg6PRQMZg5wlYpWMieYe5uvi1yE/FNHC46PdgSDLIw5RESWlVwT169MsVB1MnqPMPqGcetBBLgKTEnyL1dE3ECgYEA/qmxj17lQIpliiyc/VBBS7pP6I6I1dlo+wYdhsyx4KVYrvOOthrmjI5fZF+P0+cToPu9MU/ib0TdhM4QwSizhOQr4XMHEsidhN+F/XSZdbkNbP80KAcBQKFhKDgUV1ygBorDmZq56iYgx2OTKtIPCuTwnx5jPsOpVA4NS4vl7n0CgYEA8NV3cZdLJoRUKvzPKXyhuJtp5VvPaxRpeVRQOcbnI4W8lMebzDk+Abi5w8kstjIPVJ2e6P59FUlA5AjNOCVVrpognv+WwXVxtLtEe+HB2n7bc0S77BUNhTWG/C+i8vPCWV6RyggbhPCNUZpboA6G1oY6AQGexc+PJbplkhebkh0CgYEAztIwM1kFZNJBPuOWqB/Kt97bUOqZdNv554yC5FxPxjti98s0Ru83+EUUcecuXxFXHrH0aB0Rr/5EzbuxXb5ZdX79qD6MKxQk4anLHxnYHASrQ69Lw4pU2RF3X3uUAZNnH4kI7DH99Yz7qBNVjTxGHTnrtb6vKWUsmuhCoe0/Ut0CgYEAwZsJ+5IhwuQMecZkj7h2ld6yYcTN2Qo+xF/oYpooxGDFumFBOQsncuDaza8TN6DEvEQ+NJYpXgxWkzsUJze0Srny0X8s5XcRorYNFv3lBk6HAoJWBDLkfJsMWf29pEwbiBbDYsPjw5pSMTDCycgD079yL87qoaD7NdxDvQ8nbG0CgYA6RtRfrOR2OnZk5TU856QoL1MvwxfeBUmX1rb6e9+Fotkla+D2pzE+k6mR3TBOSj5v62yA3zYexn9+l6M81sY3knR1HmjlIpoimDGKzMPdYd3Yw9/4i3jtzvB4tHwJZy8xg2cg1bZ9rHzf4MeA3lLz4IKlsF1+jME4ge+kMHkSPg==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA75NweQYywGlQGSXqJPxl57aJyalaVfCdq1VTXlPFakGUaVYqtVvLIZspruAbqRfExOKG5v20HgS5KmjgiIkcnyghxm6M44lZDRhn3OR+aKvBsl0RSglqoPRZ8RiZuTGrvYetNJHEx0v+UxKYDqd3YZ1vSx8opty7H7g/5XIj/zA9BecyEoP/mLcAQUn27Xe3bLTU8uKAA22pxxCuejF05+lVuhFCfhLVVCheKm21U1BH/pQnvXtR3s1Hz/WZO6TOEzyTAe9I1saoeef4axOwUhXwlxXNvGKnyUkPiIfVK4AdkSmT26oD8+crYNjov9L8T7cUbYSccnQ3h0hGm75OKQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "https://api.nbyid.cn/mlcc/ali/pay/fallback";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "https://www.nbyid.cn";

    // 支付宝网关
    // 正式环境
    public static String gatewayUrl = "https://openapi.alipay.com/gateway.do";
    // 沙箱环境
//    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    @Bean
    public DefaultAlipayClient getDefaultAlipayClient() {
        // 初始化支付宝客户端
        return new DefaultAlipayClient(AlipayConfig.gatewayUrl, AlipayConfig.app_id, AlipayConfig.merchant_private_key
                , "json", "utf-8", AlipayConfig.alipay_public_key, "RSA2");
    }
}
